<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/3/7
  Time: 9:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
</head>
<body>
<form method="post" action="${pageContext.request.contextPath}/user/doAdd">
    <table>
        <tr>
            <td>
                账号
            </td>
            <td>
                <input type="text" name="account" id="account">
            </td>
        </tr>
        <tr>
            <td>
                密码
            </td>
            <td>
                <input type="text" name="password" id="password">
            </td>
        </tr>
        <tr>
            <td>
                生日3
            </td>
            <td>
                <input type="text" name="birthday" id="birthday">
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="提交">
            </td>
        </tr>
    </table>
</form>
</body>

<script>
    $(function () {
        $("#account").blur(function () {
            console.log(".......");
            $.ajax({
                //"url": "/ch15/user/findByAccount?account=" + $("#account").val(),
                "url": "/ch15/user/doLogin",
                "type": "post",
                "data": JSON.stringify({'account': 'lisi', 'password': '111'}),
                "contentType":"application/json",
                "dataType": "json",
                "success": function (data) {
                    console.log(data);
                    //  if (data.exist == 0) {
                    //      console.log("不存在");
                    //  } else {
                    //      console.log("存在");
                    //   }
                }
            })
        })
    })

</script>
</html>
